package com.zbf.excel;

import com.alibaba.excel.EasyExcel;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

/** 
 * author: LCG
 * date: 2022/4/13
 * description:
 */
public class VedioExcelHandler {

    public static void main(String[] args) throws FileNotFoundException {
        String filePath;
        filePath = "C:\\Users\\lenovo\\Desktop\\产品及视频发布数据-日更.xlsx";

        String templateName = "C:\\Users\\lenovo\\Desktop\\模板.xlsx";

        FileInputStream fileInputStream = new FileInputStream(filePath);

        VedioDataListener vedioDataListener = new VedioDataListener();
        EasyExcel.read(fileInputStream, VedioData.class, vedioDataListener).sheet().headRowNumber(3).doRead();

        EasyExcel.write("D:/测试.xlsx", VedioData.class).withTemplate(templateName).sheet(0, "全国视频发布").doWrite(vedioDataListener.getList());

    }

}
